#----------------------------------------------------------------------------------------#
#
#   CTestConfig.cmake template for Kokkos
#
#----------------------------------------------------------------------------------------#

#
#   dash-board related
#
set(CTEST_PROJECT_NAME "Kokkos")
set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
set(CTEST_DROP_METHOD "https")
set(CTEST_DROP_SITE "cdash.nersc.gov")
set(CTEST_DROP_LOCATION "/submit.php?project=${CTEST_PROJECT_NAME}")
set(CTEST_CDASH_VERSION "1.6")
set(CTEST_CDASH_QUERY_VERSION TRUE)
set(CTEST_SUBMIT_RETRY_COUNT "1")
set(CTEST_SUBMIT_RETRY_DELAY "30")

#
#   configure/build related
#
set(CTEST_BUILD_NAME "@BUILD_NAME@")
set(CTEST_MODEL "@MODEL@")
set(CTEST_SITE "@SITE@")
set(CTEST_CONFIGURATION_TYPE "@BUILD_TYPE@")
set(CTEST_SOURCE_DIRECTORY "@SOURCE_REALDIR@")
set(CTEST_BINARY_DIRECTORY "@BINARY_REALDIR@")

#
#   configure/build related
#
set(CTEST_UPDATE_TYPE "git")
set(CTEST_UPDATE_VERSION_ONLY ON)
# set(CTEST_GENERATOR "")
# set(CTEST_GENERATOR_PLATFORM "")

#
#   testing related
#
set(CTEST_TIMEOUT "7200")
set(CTEST_TEST_TIMEOUT "7200")
set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS "100")
set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS "100")
set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE "1048576")

#
#   coverage related
#
set(CTEST_CUSTOM_COVERAGE_EXCLUDE ".*tpls/.*;/usr/.*;.*unit_test/.*;.*unit_tests/.*;.*perf_test/.*")

#
#   commands
#
if(NOT "@CHECKOUT_COMMAND@" STREQUAL "")
    set(CTEST_CHECKOUT_COMMAND "@CHECKOUT_COMMAND@")
endif()
set(CTEST_UPDATE_COMMAND "@GIT_EXECUTABLE@")
set(CTEST_CONFIGURE_COMMAND "@CMAKE_COMMAND@ -DCMAKE_BUILD_TYPE=@BUILD_TYPE@ -DKokkos_ENABLE_TESTS=ON @CONFIG_ARGS@ @SOURCE_REALDIR@")
set(CTEST_BUILD_COMMAND "@CMAKE_COMMAND@ --build @BINARY_REALDIR@ --target @TARGET@")
if(NOT WIN32)
    set(CTEST_BUILD_COMMAND "${CTEST_BUILD_COMMAND} -- -j@BUILD_JOBS@")
endif()
set(CTEST_COVERAGE_COMMAND "gcov")
set(CTEST_MEMORYCHECK_COMMAND "valgrind")
set(CTEST_GIT_COMMAND "@GIT_EXECUTABLE@")

#
#   various configs
#
set(APPEND_VALUE @APPEND@)
if(APPEND_VALUE)
    set(APPEND_CTEST APPEND)
endif()

macro(SET_TEST_PROP VAR)
    if(NOT "${ARGS}" STREQUAL "")
        set(${VAR}_CTEST ${VAR} ${ARGN})
    endif()
endmacro()

set_test_prop(START           @START@)
set_test_prop(END             @END@)
set_test_prop(STRIDE          @STRIDE@)
set_test_prop(INCLUDE         @INCLUDE@)
set_test_prop(EXCLUDE         @EXCLUDE@)
set_test_prop(INCLUDE_LABEL   @INCLUDE_LABEL@)
set_test_prop(EXCLUDE_LABEL   @EXCLUDE_LABEL@)
set_test_prop(PARALLEL_LEVEL  @PARALLEL_LEVEL@)
set_test_prop(STOP_TIME       @STOP_TIME@)
set_test_prop(COVERAGE_LABELS @LABELS@)
